package org.suk.dp.responsibilityChain.example;

import java.text.MessageFormat;

/**
 * Description: 总经理<br/>
 * @version V1.0  2017/6/22 10:46  by 石冬冬(dongdong.shi@ucarinc.com) - Heil Hitler
 */
public class GeneralManager extends Manager {
    public GeneralManager(String name) {
        super(name);
    }

    @Override
    public void requestApplications(Request request) {
        if(request.getRequestType() == Request.RequestTypeEnum.LEAVE){
            System.out.println(MessageFormat.format("{0}:{1} 数量{2}天 被批准",this.name,request.getContent(),request.getNumber()));
        }else if(request.getRequestType() == Request.RequestTypeEnum.SALARY && request.getNumber() <= 500){
            System.out.println(MessageFormat.format("{0}:{1} 数量{2}￥ 被批准",this.name,request.getContent(),request.getNumber()));
        }else if(request.getRequestType() == Request.RequestTypeEnum.SALARY && request.getNumber() > 500){
            System.out.println(MessageFormat.format("{0}:{1} 数量{2}￥ 再说吧",this.name,request.getContent(),request.getNumber()));
        }
    }
}
